package com.mpgame.common.mq;

import java.util.Map;
import org.apache.kafka.common.serialization.Serializer;
import com.google.protobuf.Message;

public class ProtobufSerializer<T extends Message> implements Serializer<T> {
    @Override public void configure(Map<String, ?> configs, boolean isKey) {}
    @Override public byte[] serialize(String topic, T data) {
        return data == null ? null : data.toByteArray();
    }
    @Override public void close() {}
}
